package com.urban.pooling.util;

import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;

public class AppUtil {
	public static final String DATE_TIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ssZ";

	/**
	 * Returns the username of the authenticated user on the session from which
	 * the method is called.
	 * 
	 * @return
	 */
	public static String getAuthenthicatedUsername() {
		Authentication auth = SecurityContextHolder.getContext()
				.getAuthentication();
		return auth.getName();
	}
}
